<!-- ...new file... -->
<!DOCTYPE html>
<html>
<head>
    <title>回收站</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <div class="container dashboard" style="background:#f9f9f9; padding:2rem; border-radius:8px;">
        <h2 style="color:#e67e22;"><i class="fas fa-trash"></i> 回收站</h2>
        {% with messages = get_flashed_messages(with_categories=true) %}
          {% if messages %}
            {% for category, message in messages %}
              <div class="flash-messages flash-{{ category }}">
                {{ message }}
              </div>
            {% endfor %}
          {% endif %}
        {% endwith %}
        <a href="{{ url_for('dashboard') }}" class="btn btn-primary" style="margin-bottom:1rem;">
            <i class="fas fa-home"></i> 返回网盘
        </a>
        {% if files %}
        <table class="file-table" style="background:#fff; border-radius:8px;">
            <tr>
                <th>文件名</th>
                <th>大小</th>
                <th>上传时间</th>
                <th>操作</th>
            </tr>
            {% for file in files %}
            <tr>
                <td>{{ file.filename }}</td>
                <td>{{ file.formatted_size }}</td>
                <td>{{ file.upload_time }}</td>
                <td>
                    <form method="post" action="{{ url_for('restore_file', file_id=file.id) }}" style="display:inline;">
                        <button type="submit" class="btn btn-success">恢复</button>
                    </form>
                    <form method="post" action="{{ url_for('purge_file', file_id=file.id) }}" style="display:inline;">
                        <button type="submit" class="btn btn-danger" onclick="return confirm('彻底删除后无法恢复，确定吗？')">彻底删除</button>
                    </form>
                </td>
            </tr>
            {% endfor %}
        </table>
        {% else %}
        <div style="padding: 2rem; text-align: center; color: #777;">
            回收站为空
        </div>
        {% endif %}
    </div>
</body>
</html>
